<template>
    <div>
        <van-form>
        <van-field label="手机号" placeholder="请输入手机号" v-model="form.name" :rules="[{ required: true, message: '请填写用户名' }]"/>
        <van-field label="验证码" placeholder="请输入验证码" v-model="form.code" :rules="[{ required: true, message: '请填写验证码' }]"/>
        </van-form>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                form:{}
            }
        },
        methods:{
            send(){
                //1.手机号有效性验证
                let reg=/^1[3-9]\d{9}$/
                if(!reg.test(this.mobile)){
                    alert('手机号不合法')
                    return false;
                }
                //2.调用发短信接口
                this.$axios.get('sendsms?mobile='+)
            },
        },
        mounted(){},
    }
</script>

<style scoped>

</style>